#include <cstdio>

int main( )
{
    int t, k, n, p, p1, p2, q, ac[ 6 ] = { 1, 2, 3, 4, 4, 6 }, a;
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%d%d", &n, &k);
        if ( k <= n / 2 )
        {
            printf("1/%d\n", n - k + 1);
            continue;
        }
        if ( n >= 10 )
        {
            q = ( n - 10 ) / 6 * 5 + 9 + ac[ ( n - 10 ) % 6 ];
            if ( k < q )
            {
                p = k - n / 2;
                if ( p & 1 )
                    printf("1/%d\n", n - n / 2 - ( p - 1 ) / 2);
                else
                    printf("2/%d\n", n - p + 1 + ( n % 2 ));
            }
            else
            {
                p = k - q;
                if ( p & 1 )
                {
                    p1 = ( p - 1 ) / 2;
                    p2 = ( p + 1 ) / 2;
                    if ( n % 3 == 0 )
                    {
                        a = n - 1 - 3 * ( p1 / 2 ) - ( p1 % 2 );
                        a += n - 1 - 3 * ( p2 / 2 ) - ( p2 % 2 );
                    }
                    if ( n % 3 == 2 )
                    {
                        a = n - 3 * ( p1 / 2 ) - ( p1 % 2 );
                        a += n - 3 * ( p2 / 2 ) - ( p2 % 2 );
                    }
                    if ( n % 3 == 1 )
                    {
                        a = n - 3 * ( p1 / 2 ) - ( p1 % 2 ) * 2;
                        a += n - 3 * ( p2 / 2 ) - ( p2 % 2 ) * 2;
                    }
                    if ( a % 6 == 0 )
                        printf("1/%d\n", a / 6);
                    else
                        printf("2/%d\n", a / 3);
                }
                else
                {
                    p /= 2;
                    if ( n % 3 == 0 )
                        printf("3/%d\n", n - 1 - 3 * ( p / 2 ) - ( p % 2 ));
                    if ( n % 3 == 2 )
                        printf("3/%d\n", n - 3 * ( p / 2 ) - ( p % 2 ));
                    if ( n % 3 == 1 )
                        printf("3/%d\n", n - 3 * ( p / 2 ) - ( p % 2 ) * 2);
                }
            }
        }
        else
        {
            if ( n == 8 && k == 8 )
            {
                printf("3/8\n");
                continue;
            }
            p = k - n / 2;
            if ( p & 1 )
                printf("1/%d\n", n - n / 2 - ( p - 1 ) / 2);
            else
                printf("2/%d\n", n - p + 1 + ( n % 2 ));
        }
    }
    return 0;
}
